<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>AmpleHarvest: cTABLE_Metric.php Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">AmpleHarvest
   &#160;<span id="projectnumber">0.0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('c_t_a_b_l_e___metric_8php.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">cTABLE_Metric.php</div>  </div>
</div>
<div class="contents">
<a href="c_t_a_b_l_e___metric_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00005"></a>00005         use\ampleharvest\code;
<a name="l00006"></a>00006         require_once dirname(dirname(dirname(__FILE__))) . <span class="stringliteral">&#39;/config/cConfig.php&#39;</span>;
<a name="l00007"></a>00007         <span class="comment">//require_once dirname(dirname(dirname(__FILE__))) . &#39;/external/utf8.php&#39;;</span>
<a name="l00011"></a>00011 <span class="comment"></span>        require_once code\cConfig::C_STR_DATABASE_LIB_PATH . <span class="stringliteral">&quot;/Classes/cTable.php&quot;</span>;
<a name="l00015"></a>00015         require_once code\cConfig::C_STR_DATABASE_LIB_PATH . <span class="stringliteral">&quot;/Classes/ColTypes.php&quot;</span>;
<a name="l00016"></a>00016 
<a name="l00030"></a><a class="code" href="classc_t_a_b_l_e___metric.html">00030</a>         <span class="keyword">class </span><a class="code" href="classc_t_a_b_l_e___metric.html" title="Includes the base class for Tables (uses base path from the cinfo file.">cTABLE_Metric</a> <span class="keyword">extends</span> cTable
<a name="l00031"></a>00031         {
<a name="l00036"></a><a class="code" href="classc_t_a_b_l_e___metric.html#af5f24276e86111f5d231566eb8f54fdd">00036</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#af5f24276e86111f5d231566eb8f54fdd">C_STR_CATEGORY_HIT_COUNT</a> = <span class="stringliteral">&quot;HIT_COUNT&quot;</span>;
<a name="l00037"></a><a class="code" href="classc_t_a_b_l_e___metric.html#afa3401721b9de2684d7070a69a64cd82">00037</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#afa3401721b9de2684d7070a69a64cd82">C_STR_CATEGORY_TOTAL_PAGES</a> = <span class="stringliteral">&quot;TOTAL_PAGES&quot;</span>;
<a name="l00038"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a5ad0d0585aeaf9968795c725156088d4">00038</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a5ad0d0585aeaf9968795c725156088d4">C_STR_CATEGORY_TOTAL_USERS</a> = <span class="stringliteral">&quot;TOTAL_USERS&quot;</span>;
<a name="l00039"></a>00039 
<a name="l00040"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a1bf5ae82a96ad7e0e1b07c87c6fb57ef">00040</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a1bf5ae82a96ad7e0e1b07c87c6fb57ef">C_STR_SUBCATEGORY_HOURLY</a> = <span class="stringliteral">&quot;HOURLY&quot;</span>;
<a name="l00041"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a70ecaf3514327eec641e533ced0414eb">00041</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a70ecaf3514327eec641e533ced0414eb">C_STR_SUBCATEGORY_DAILY</a> = <span class="stringliteral">&quot;DAILY&quot;</span>;
<a name="l00042"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a853794917cd2b086c4c6dfe78a276e3b">00042</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a853794917cd2b086c4c6dfe78a276e3b">C_STR_SUBCATEGORY_WEEKLY</a> = <span class="stringliteral">&quot;WEEKLY&quot;</span>;
<a name="l00043"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a5912dd9fb986e65c14ed76ef23ceec44">00043</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a5912dd9fb986e65c14ed76ef23ceec44">C_STR_SUBCATEGORY_MONTHLY</a> = <span class="stringliteral">&quot;MONTHLY&quot;</span>;
<a name="l00044"></a><a class="code" href="classc_t_a_b_l_e___metric.html#abf28e3f5782104aea64c7fa58bc09ec0">00044</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#abf28e3f5782104aea64c7fa58bc09ec0">C_STR_SUBCATEGORY_YEARLY</a> = <span class="stringliteral">&quot;YEARLY&quot;</span>;
<a name="l00045"></a><a class="code" href="classc_t_a_b_l_e___metric.html#ae8e512ba7f7738a431d354274a279892">00045</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#ae8e512ba7f7738a431d354274a279892">C_STR_SUBCATEGORY_TOTAL</a> = <span class="stringliteral">&quot;TOTAL&quot;</span>;
<a name="l00046"></a>00046                 
<a name="l00047"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a4e87f5ed9b6433501db86c71d0030f8f">00047</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a4e87f5ed9b6433501db86c71d0030f8f">C_STR_SUBCATEGORY_ARTICLE</a> = <span class="stringliteral">&quot;ARTICLE&quot;</span>;
<a name="l00048"></a>00048                 
<a name="l00049"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a465552f237ddf8c11c6d68b70dd34419">00049</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a465552f237ddf8c11c6d68b70dd34419">C_STR_GROUP_SOLR</a> = <span class="stringliteral">&quot;SOLR&quot;</span>;
<a name="l00050"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a5531042d38b2091c69856ada54005557">00050</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a5531042d38b2091c69856ada54005557">C_STR_GROUP_ACTIVE</a> = <span class="stringliteral">&quot;ACTIVE&quot;</span>;
<a name="l00051"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a25c3d9180f847b6a3bda3bbf7f194448">00051</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a25c3d9180f847b6a3bda3bbf7f194448">C_STR_GROUP_TOTAL</a> = <span class="stringliteral">&quot;TOTAL&quot;</span>;
<a name="l00052"></a>00052                 
<a name="l00053"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a5b421cc5bdd72dee54bd2e3df20f1322">00053</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a5b421cc5bdd72dee54bd2e3df20f1322">C_STR_GROUP_INDEX_ERROR</a> = <span class="stringliteral">&quot;INDEX_ERROR&quot;</span>;<span class="comment">//-2</span>
<a name="l00054"></a><a class="code" href="classc_t_a_b_l_e___metric.html#ae4fa72697b872cd5fb3aa354e8cd3ee1">00054</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#ae4fa72697b872cd5fb3aa354e8cd3ee1">C_STR_GROUP_PROCESS_ERROR</a> = <span class="stringliteral">&quot;PROCESS_ERROR&quot;</span>;<span class="comment">//-1</span>
<a name="l00055"></a><a class="code" href="classc_t_a_b_l_e___metric.html#afb71d37017780cf68027ce3107482f1f">00055</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#afb71d37017780cf68027ce3107482f1f">C_STR_GROUP_NEW</a> = <span class="stringliteral">&quot;NEW&quot;</span>;<span class="comment">//0</span>
<a name="l00056"></a><a class="code" href="classc_t_a_b_l_e___metric.html#ad48b1a23be2bc26899d5e001162f7711">00056</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#ad48b1a23be2bc26899d5e001162f7711">C_STR_GROUP_PROCESSING</a> = <span class="stringliteral">&quot;PROCESSING&quot;</span>;<span class="comment">//1</span>
<a name="l00057"></a><a class="code" href="classc_t_a_b_l_e___metric.html#aad70e65c1af3d8effecd3ccdf2da5478">00057</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#aad70e65c1af3d8effecd3ccdf2da5478">C_STR_GROUP_PROCESSED</a> = <span class="stringliteral">&quot;PROCESSED&quot;</span>;<span class="comment">//2</span>
<a name="l00058"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a84ceb372a682ca8f0964514b745d2597">00058</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a84ceb372a682ca8f0964514b745d2597">C_STR_GROUP_INDEXING</a> = <span class="stringliteral">&quot;INDEXING&quot;</span>;<span class="comment">//3</span>
<a name="l00059"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a390d610445a2ca0ca1ac63e83be2b058">00059</a>                 <span class="keyword">const</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a390d610445a2ca0ca1ac63e83be2b058">C_STR_GROUP_INDEXED</a> = <span class="stringliteral">&quot;INDEXED&quot;</span>;<span class="comment">//4</span>
<a name="l00068"></a><a class="code" href="classc_t_a_b_l_e___metric.html#ad077898da1668be20c85ec881a673c2e">00068</a> <span class="comment"></span>                <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___metric.html#ad077898da1668be20c85ec881a673c2e">$m_int_COL_ID</a> = null;
<a name="l00069"></a><a class="code" href="classc_t_a_b_l_e___metric.html#aaced9e60caf8f5bd245245bdfdd4e252">00069</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___metric.html#aaced9e60caf8f5bd245245bdfdd4e252">$m_int_COL_DateTime</a> = null;
<a name="l00070"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a514a7d018a27972078a89834ecfc19bb">00070</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a514a7d018a27972078a89834ecfc19bb">$m_int_COL_Category</a> = null;
<a name="l00071"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a9ee192d0fbe010e310fee2483139b6be">00071</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a9ee192d0fbe010e310fee2483139b6be">$m_int_COL_Group</a>= null;
<a name="l00072"></a><a class="code" href="classc_t_a_b_l_e___metric.html#afbcb7750fc518c35e13d95d7fe3a4c95">00072</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___metric.html#afbcb7750fc518c35e13d95d7fe3a4c95">$m_int_COL_Subcategory</a> = null;
<a name="l00073"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a742460a95308e09a9cf0a1aa3e5f5bdf">00073</a>                 <span class="keyword">public</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a742460a95308e09a9cf0a1aa3e5f5bdf">$m_int_COL_Value</a> = null;
<a name="l00074"></a>00074 
<a name="l00082"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a095c5d389db211932136b53f25f39685">00082</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a095c5d389db211932136b53f25f39685" title="This constructor sets all the required column data.">__construct</a>()
<a name="l00083"></a>00083                 {
<a name="l00084"></a>00084                         $this-&gt;m_str_TableName = <span class="stringliteral">&quot;metric&quot;</span>;
<a name="l00085"></a>00085                         $this-&gt;set_Engine(self::C_STR_ENGINE_INNODB);
<a name="l00086"></a>00086                         <span class="comment">//$this-&gt;set_CharSet(self::C_STR_CHAR_SET_BINARY);</span>
<a name="l00087"></a>00087                         <span class="comment">//$this-&gt;set_Collation(self::C_STR_COLLATION_BINARY);</span>
<a name="l00088"></a>00088 
<a name="l00089"></a>00089                         <span class="comment">//Create Column Objects</span>
<a name="l00090"></a>00090                         $obj_COL_ID = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;id&quot;</span>);
<a name="l00091"></a>00091                         $obj_COL_ID-&gt;set_Length(36);
<a name="l00092"></a>00092                         $obj_COL_ID-&gt;set_Index(abs_Column::c_int_INDEX_PRIMARY);
<a name="l00093"></a>00093                         $obj_COL_ID-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the ID of the Metric Data.&quot;</span>);
<a name="l00094"></a>00094                         $obj_COL_ID-&gt;set_Editable(<span class="keyword">false</span>);
<a name="l00095"></a>00095                         $obj_COL_ID-&gt;set_Label(<span class="stringliteral">&quot;ID&quot;</span>);
<a name="l00096"></a>00096 
<a name="l00097"></a>00097                         $obj_COL_Category = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;category&quot;</span>);
<a name="l00098"></a>00098                         $obj_COL_Category-&gt;set_Length(50);
<a name="l00099"></a>00099                         $obj_COL_Category-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00100"></a>00100                         $obj_COL_Category-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the category of the metric.&quot;</span>);
<a name="l00101"></a>00101                         $obj_COL_Category-&gt;set_Label(<span class="stringliteral">&quot;Category&quot;</span>);
<a name="l00102"></a>00102 
<a name="l00103"></a>00103                         $obj_COL_Group = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;group&quot;</span>);
<a name="l00104"></a>00104                         $obj_COL_Group-&gt;set_Length(200);
<a name="l00105"></a>00105                         $obj_COL_Group-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00106"></a>00106                         $obj_COL_Group-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the group to wich this set of data belongs.&quot;</span>);
<a name="l00107"></a>00107                         $obj_COL_Group-&gt;set_Label(<span class="stringliteral">&quot;group&quot;</span>);
<a name="l00108"></a>00108 
<a name="l00109"></a>00109                         $obj_COL_SubCategory = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;subcategory&quot;</span>);
<a name="l00110"></a>00110                         $obj_COL_SubCategory-&gt;set_Length(50);
<a name="l00111"></a>00111                         $obj_COL_SubCategory-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00112"></a>00112                         $obj_COL_SubCategory-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the subcategory of the metric.&quot;</span>);
<a name="l00113"></a>00113                         $obj_COL_SubCategory-&gt;set_Label(<span class="stringliteral">&quot;Subcategory&quot;</span>);
<a name="l00114"></a>00114 
<a name="l00115"></a>00115                         $obj_COL_Date = <span class="keyword">new</span> cColDateTime(<span class="stringliteral">&quot;datetime&quot;</span>);
<a name="l00116"></a>00116                         $obj_COL_Date-&gt;set_Index(abs_Column::c_int_INDEX_INDEX);
<a name="l00117"></a>00117                         $obj_COL_Date-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the date/time the data was collected.&quot;</span>);
<a name="l00118"></a>00118                         $obj_COL_Date-&gt;set_Label(<span class="stringliteral">&quot;Date Collected&quot;</span>);
<a name="l00119"></a>00119 
<a name="l00120"></a>00120                         $obj_COL_Value = <span class="keyword">new</span> cColVarChar(<span class="stringliteral">&quot;value&quot;</span>);
<a name="l00121"></a>00121                         $obj_COL_Value-&gt;set_Length(100);
<a name="l00122"></a>00122                         $obj_COL_Value-&gt;set_Comment(<span class="stringliteral">&quot;This column holds the Value collected.&quot;</span>);
<a name="l00123"></a>00123                         $obj_COL_Value-&gt;set_Label(<span class="stringliteral">&quot;Value&quot;</span>);
<a name="l00124"></a>00124 
<a name="l00125"></a>00125                         <span class="comment">//Set up connection</span>
<a name="l00126"></a>00126                         $this-&gt;m_obj_Connection = <span class="keyword">new</span> cConnection(<span class="stringliteral">&quot;AmpleHarvest&quot;</span>, <span class="stringliteral">&quot;admin&quot;</span>);
<a name="l00127"></a>00127 
<a name="l00128"></a>00128                         <span class="comment">//Activate all Debug options</span>
<a name="l00129"></a>00129                         $this-&gt;m_obj_Connection-&gt;set_DebugLevel(cLog_Connection_Debug::c_int_LEVEL_HIDDEN);
<a name="l00130"></a>00130                         $this-&gt;m_obj_Connection-&gt;set_LogLevel(cLog_Connection::c_int_LEVEL_BASIC);
<a name="l00131"></a>00131                         <span class="comment">//$this-&gt;m_obj_Connection-&gt;activate_Logging();</span>
<a name="l00132"></a>00132                         <span class="comment">//$this-&gt;m_obj_Connection-&gt;activate_LogDebug();</span>
<a name="l00133"></a>00133                         <span class="comment">//$this-&gt;m_obj_Connection-&gt;activate_ScreenDebug();</span>
<a name="l00134"></a>00134 
<a name="l00135"></a>00135                         $this-&gt;m_int_COL_ID = $this-&gt;add_Column($obj_COL_ID);
<a name="l00136"></a>00136                         $this-&gt;m_int_COL_DateTime = $this-&gt;add_Column($obj_COL_Date);
<a name="l00137"></a>00137                         $this-&gt;m_int_COL_Category = $this-&gt;add_Column($obj_COL_Category);
<a name="l00138"></a>00138                         $this-&gt;m_int_COL_Group = $this-&gt;add_Column($obj_COL_Group);
<a name="l00139"></a>00139                         $this-&gt;m_int_COL_Subcategory = $this-&gt;add_Column($obj_COL_SubCategory);
<a name="l00140"></a>00140                         $this-&gt;m_int_COL_Value = $this-&gt;add_Column($obj_COL_Value);
<a name="l00141"></a>00141                 }
<a name="l00142"></a>00142 
<a name="l00143"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a0001ac169d54c3f492f107fb76d678c2">00143</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a0001ac169d54c3f492f107fb76d678c2">insert_DefaultData</a>()
<a name="l00144"></a>00144                 {
<a name="l00145"></a>00145 
<a name="l00146"></a>00146                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00147"></a>00147                 }
<a name="l00148"></a>00148 
<a name="l00154"></a><a class="code" href="classc_t_a_b_l_e___metric.html#acbb490790d87e7fdee9fc1d53354947b">00154</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___metric.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00155"></a>00155                 {
<a name="l00156"></a>00156                         <span class="comment">// ensure that there is an ID passed and that it is a valid GUID</span>
<a name="l00157"></a>00157                         <span class="keywordflow">if</span> (!empty(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>) &amp;&amp; preg_match(self::c_REG_GUID_VALID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>))
<a name="l00158"></a>00158                         {
<a name="l00159"></a>00159                                 $this-&gt;clear_Query();
<a name="l00160"></a>00160                                 $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>);
<a name="l00161"></a>00161                                 <span class="keywordflow">if</span> ($this-&gt;do_Search() &gt; 0)
<a name="l00162"></a>00162                                 {
<a name="l00163"></a>00163                                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00164"></a>00164                                 }
<a name="l00165"></a>00165                         }
<a name="l00166"></a>00166                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00167"></a>00167                 }
<a name="l00168"></a>00168 
<a name="l00174"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a7f7d36d28f818d0d64ae30da6f170a0a">00174</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a7f7d36d28f818d0d64ae30da6f170a0a" title="Loads information into object from Database based on ID passed.">load_DataFromID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>)
<a name="l00175"></a>00175                 {
<a name="l00176"></a>00176                         $this-&gt;clear();
<a name="l00177"></a>00177 
<a name="l00178"></a>00178                         <span class="keywordflow">if</span> ($this-&gt;<a class="code" href="classc_t_a_b_l_e___metric.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>(<a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>))
<a name="l00179"></a>00179                         {
<a name="l00180"></a>00180                                 $this-&gt;clear_Query();
<a name="l00181"></a>00181                                 $this-&gt;add_ColumnQuery($this-&gt;m_int_COL_ID, <a class="code" href="task__runner_8php.html#a638f33f9a90952d7cebdf44588e8f40b">$str_ID</a>);
<a name="l00182"></a>00182                                 <span class="keywordflow">if</span> ($this-&gt;do_Search() &gt; 0)
<a name="l00183"></a>00183                                 {
<a name="l00184"></a>00184                                         $obj_RS = $this-&gt;get_ResultSet();
<a name="l00185"></a>00185                                         <span class="keywordflow">if</span> ($obj_RS[0])
<a name="l00186"></a>00186                                         {
<a name="l00187"></a>00187                                                 $this-&gt;load_DataFromArray($obj_RS[0]);
<a name="l00188"></a>00188                                                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00189"></a>00189                                         }
<a name="l00190"></a>00190                                 }
<a name="l00191"></a>00191                         }
<a name="l00192"></a>00192                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00193"></a>00193                 }
<a name="l00194"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a2055504e90b0a396c1de85aaad0c80ab">00194</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a2055504e90b0a396c1de85aaad0c80ab">insert_Data2DB</a>()
<a name="l00195"></a>00195                 {
<a name="l00196"></a>00196                         <span class="keywordflow">if</span> (!$this-&gt;get_id())
<a name="l00197"></a>00197                         {
<a name="l00198"></a>00198                                 $this-&gt;set_id($this-&gt;create_GUID());
<a name="l00199"></a>00199                         }
<a name="l00200"></a>00200 
<a name="l00201"></a>00201                         <span class="keywordflow">if</span> (!$this-&gt;get_datetime())
<a name="l00202"></a>00202                         {
<a name="l00203"></a>00203                                 $obj_Date = <span class="keyword">new</span> DateTime();
<a name="l00204"></a>00204                                 $this-&gt;set_datetime($obj_Date-&gt;format(<span class="stringliteral">&quot;Y-m-d H:i:s&quot;</span>));
<a name="l00205"></a>00205                         }
<a name="l00206"></a>00206 
<a name="l00207"></a>00207                         <span class="keywordflow">return</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a2055504e90b0a396c1de85aaad0c80ab">parent::insert_Data2DB</a>();
<a name="l00208"></a>00208                 }
<a name="l00209"></a>00209 
<a name="l00213"></a><a class="code" href="classc_t_a_b_l_e___metric.html#a42e7dcfc7851c0dedcafb63968ffbc02">00213</a>                 <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classc_t_a_b_l_e___metric.html#a42e7dcfc7851c0dedcafb63968ffbc02" title="Saves Information to the Database.">save_Data2DB</a>()
<a name="l00214"></a>00214                 {
<a name="l00215"></a>00215                         <span class="keywordflow">if</span> ($this-&gt;<a class="code" href="classc_t_a_b_l_e___metric.html#acbb490790d87e7fdee9fc1d53354947b" title="Returns if the id is a valid and existing ID.">validate_ID</a>($this-&gt;get_id()))
<a name="l00216"></a>00216                         {
<a name="l00217"></a>00217                                 <span class="keywordflow">return</span> $this-&gt;update_Data2DB();
<a name="l00218"></a>00218                         }
<a name="l00219"></a>00219                         <span class="keywordflow">else</span>
<a name="l00220"></a>00220                         {
<a name="l00221"></a>00221                                 <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classc_t_a_b_l_e___metric.html#a2055504e90b0a396c1de85aaad0c80ab">insert_Data2DB</a>();
<a name="l00222"></a>00222                         }
<a name="l00223"></a>00223                 }
<a name="l00224"></a>00224         }
<a name="l00225"></a>00225 ?&gt;
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="c_t_a_b_l_e___metric_8php.html">cTABLE_Metric.php</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Mon Jan 23 2012 13:34:20 for AmpleHarvest by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
